package com.bite.config.demo.controller;

import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/log")
@RestController
public class LogController {
    //学习一个新注解 @Slf4j 代表下面这行代码
//    private static Logger log = LoggerFactory.getLogger(LogController.class);

    @PostConstruct
    public void print(){
        System.out.println("打印日志");
        log.trace("我是trace日志");
        log.debug("我是debug日志");
        log.info("我是info日志");
        log.warn("我是warn日志");
        log.error("我是Error日志");
    }
}
